<!DOCTYPE html>
<html xmlns:th="www.thymeleaf.org">
<head>
<meta charset="UTF-8" />
<title>UPDATE MEMBER</title>
<link rel="stylesheet" href="../../css/bootstrap/bootstrap.css"
	th:href="@{/css/bootstrap/bootstrap.css}" />
<script src="../../js/jquery-1.11.2.js" th:src="@{/js/jquery-1.11.2.js}"></script>
<script src="../../js/member.js" th:src="@{/js/member.js}"></script>
<style>
@font-face {
	font-family: 'Glyphicons Halflings';
	src: url('../fonts/glyphicons-halflings-regular.eot');
	src: url('../fonts/glyphicons-halflings-regular.eot?#iefix')
		format('embedded-opentype'),
		url('../fonts/glyphicons-halflings-regular.woff') format('woff'),
		url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),
		url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular')
		format('svg');
}
</style>
</head>
<body>
	<header></header>
	<nav class="navbar navbar-inverse">
		<div class="container-fluid">
			<div>
				<ul class="nav navbar-nav navbar-right">
					<li><a href="#"><span class="glyphicon glyphicon-search"></span>Sign
							Up</a></li>
					<li><a th:href="@{/j_spring_security_logout}"><span
							class="glyphicon glyphicon-log-out"></span>Logout</a></li>
				</ul>
			</div>
		</div>
	</nav>
	<section>
		<article class="container col-sm-10 col-sm-offset-1">
			<div id="error"></div>
			<ol class="breadcrumb">
				<li><a th:href="@{/adminaccount/home}">Home</a></li>
				<li><a th:href="@{/restaurant/list}">Member</a></li>
				<li class="active">Update</li>
			</ol>
			<div class="panel panel-success">
				<div class="panel-heading">CREATE NEW MEMBER</div>
				<div class="panel-body">
					<form id="addmember" name="addmember" method="post"
						th:action="@{/member/update}" onsubmit="return validateFormUpdate();"
						class="form-horizontal container col-sm-10 col-sm-offset-1">
						<div class="form-group">
							<label class="control-label col-sm-3" for="username">User
								Name:<span style="color: red">(*)</span>
							</label>
							<div class="col-sm-9">
								<input type="text" class="form-control" id="username"
									name="username" th:value="${member.username}"
									readonly="readonly" />
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3" for="memberName">Member
								Name: </label>
							<div class="col-sm-9">
								<input type="text" class="form-control" id="memberName"
									name="memberName" th:value="${member.memberName}" />
							</div>
						</div>
						<input type="hidden" id="email" name="email" th:value="${member.memberEmail}"/>
						<div class="form-group">
							<label class="control-label col-sm-3" for="memberEmail">Member
								Email:<span style="color: red">(*)</span>
							</label>
							<div class="col-sm-9">
								<input type="email" class="form-control" id="memberEmail"
									name="memberEmail" th:value="${member.memberEmail}" />
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3" for="memberPassword">Member
								Password:<span style="color: red">(*)</span>
							</label>
							<div class="col-sm-9">
								<input type="password" class="form-control" id="memberPassword"
									name="memberPassword" th:value="${member.memberPassword}" />
							</div>
						</div>
						<input type="hidden" id="memberBirthday"
							th:value="${member.birthday}" />
						<div class="form-group">
							<label class="control-label col-sm-3" for="birthday">Birthday:
							</label>
							<div class="col-sm-3">
								<input type="date" class="form-control" id="birthday"
									name="birthday" />
							</div>
							<script>
								document.getElementById("birthday").value = document
										.getElementById("memberBirthday").value;
							</script>
							<div>
								<label class="control-label col-sm-offset-1 col-sm-1"
									for="gender">Gender: </label> <label
									class="col-sm-offset-1 col-sm-1 radio-inline"> <input
									type="radio" name="gender" value="1"
									th:checked="${member.gender} == 'Male'" />Male
								</label> <label class="col-sm-1 radio-inline"><input
									type="radio" name="gender" value="0"
									th:checked="${member.gender} == 'Female'" />Female</label>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3" for="wardName">Ward
								Name: </label>
							<div class="col-sm-9">
								<input type="text" class="form-control" id="wardName"
									name="wardName" th:value="${member.wardName}" />
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3" for="phoneNumber">Phone
								Number: </label>
							<div class="col-sm-9">
								<input type="text" class="form-control" id="phoneNumber"
									name="phoneNumber" th:value="${member.phoneNumber}" />
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3" for="resideId">Reside:</label>
							<div class="col-sm-3">
								<select id="resideId" name="resideId" class="form-control">
									<option th:each="re : ${map.entrySet()}" th:value="${re.key}"
										th:text="${re.value}"
										th:selected="${re.key} == ${member.resideId}"></option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3" for="description">Description:</label>
							<div class="col-sm-9">
								<textarea class="form-control" rows="3" id="description"
									name="description" th:text="${member.description}"></textarea>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-3 col-sm-2">
								<button type="button" onclick="backPage()"
									class="btn btn-primary glyphicon glyphicon-backward">Back</button>
							</div>
							<div class="col-sm-offset-1 col-sm-3 pull-right">
								<a><button type="submit"
										class="btn btn-primary glyphicon glyphicon-edit">Update</button></a>
							</div>
						</div>
					</form>
				</div>
			</div>
		</article>
	</section>
	<footer class="container col-sm-12">
		<ol class="breadcrumb text-center">
			<li class="active"><p>@copyright - University Of Information
					Technology - Spring + hibernate + css3 + html5</p></li>
		</ol>
	</footer>
</body>
</html>